<?php
namespace app\backstage\validate;
use think\Validate;

class Api extends Validate
{
    protected $rule = [
        'nid'   => 'require|gt:0',
        'date'  => 'require'
    ];

    protected $message  =   [
        'nid.require'                   => '书籍ID不能为空',
        'nid.gt'                        => '书籍ID不能为空',
        'date.require' => '日期不能为空',
    ];

    protected $scene = [
        'chapters' => ['nid'],
        'book_amount' => ['date']
    ];
}